package com.dragoncombin.homework.Module03.Problem05;


// 每张扑克牌的枚举
public enum PokerCard{
    RRD_JOKER(0, "redJoker", ""), BLACK_JOKER(1, "blackJoker",""),
    CLUB_TWO(2, "2", "club"), DIAMONDS_TWO(2, "2", "diamond"), HEART_TWO(2, "2", "heart"), SPADE_TWO(2, "2", "spade"),
    CLUB_ACE(3, "A", "club"), DIAMONDS_ACE(3, "A", "diamond"), HEART_ACE(3, "A", "heart"), SPADE_ACE(3, "A", "spade"),
    CLUB_KING(4, "K", "club"), DIAMONDS_KING(4, "K", "diamond"), HEART_KING(4, "K", "heart"), SPADE_KING(4, "K", "spade"),
    CLUB_QUEEN(5, "Q", "club"), DIAMONDS_QUEEN(5, "Q", "diamond"), HEART_QUEEN(5, "Q", "heart"), SPADE_QUEEN(5, "Q", "spade"),
    CLUB_JACK(6, "J", "club"), DIAMONDS_JACK(6, "J", "diamond"), HEART_JACK(6, "J", "heart"), SPADE_JACK(6, "J", "spade"),
    CLUB_TEN(7, "10", "club"), DIAMONDS_TEN(7, "10", "diamond"), HEART_TEN(7, "10", "heart"), SPADE_TEN(7, "10", "spade"),
    CLUB_NINE(8, "9", "club"), DIAMONDS_NINE(8, "9", "diamond"), HEART_NINE(8, "9", "heart"), SPADE_NINE(8, "9", "spade"),
    CLUB_EIGHT(9, "8", "club"), DIAMONDS_EIGHT(9, "8", "diamond"), HEART_EIGHT(9, "8", "heart"), SPADE_EIGHT(9, "8", "spade"),
    CLUB_SEVEN(10, "7", "club"), DIAMONDS_SEVEN(10, "7", "diamond"), HEART_SEVEN(10, "7", "heart"), SPADE_SEVEN(10, "7", "spade"),
    CLUB_SIX(11, "6", "club"), DIAMONDS_SIX(11, "6", "diamond"), HEART_SIX(11, "6", "heart"), SPADE_SIX(11, "6", "spade"),
    CLUB_FIVE(12, "5", "club"), DIAMONDS_FIVE(12, "5", "diamond"), HEART_FIVE(12, "5", "heart"), SPADE_FIVE(12, "5", "spade"),
    CLUB_FOUR(13, "4", "club"), DIAMONDS_FOUR(13, "4", "diamond"), HEART_FOUR(13, "4", "heart"), SPADE_FOUR(13, "4", "spade"),
    CLUB_THREE(14, "3", "club"), DIAMONDS_THREE(14, "3", "diamond"), HEART_THREE(14, "3", "heart"), SPADE_THREE(14, "3", "spade");

    private int value;
    private String name;
    private String suit;

    PokerCard(int value, String name, String suit) {
        setValue(value);
        setName(name);
        setSuit(suit);
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getSuit() {
        return suit;
    }

    public void setSuit(String suit) {
        this.suit = suit;
    }


    @Override
    public String toString() {
        String symbol;
        switch (suit) {
            case "club":
                symbol = "\u2663";
                break;
            case "diamond":
                symbol = "\u2662";
                break;
            case "heart":
                symbol = "\u2661";
                break;
            case "spade":
                symbol = "\u2660";
                break;
            default:
                symbol = "";
        }

        /*return "PokerCard{" +
                "name='" + name + '\'' +
                ", suit='" + suit + '\'' +
                '}';*/
        return name + " " + symbol;
    }

}
